<template>
  <axiom-error-page
    code="404"
    title="页面未找到"
    description="抱歉，您访问的页面不存在。请检查URL是否正确，或返回首页。"
    @back="goBack"
    @home="goHome"
  />
</template>

<script setup>
import { useRouter } from "vue-router";

const router = useRouter();

const goBack = () => {
  // 避免回退到登录页
  if (window.history.length > 2) {
    router.go(-1);
  } else {
    router.push("/");
  }
};

const goHome = () => {
  router.push("/");
};
</script>